 #define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
//void* my_memcpy(void* dest, void* src, size_t value)
//{
//	assert(dest);
//	assert(src);
//	void* ret = dest;
//	while (value--)
//	{
//		*(char*)dest = *(char*)src;
//		(char*)dest = (char*)dest + 1;
//		(char*)src = (char*)src + 1;
//	}
//	return ret;
//}
//
//int main()
//{
//	int arr1[5] = { 1,2,3,4,5 };
//	int arr2[5] = { 0,0,0,0,0 };
//	my_memcpy(arr1, arr2, 8);
//	return 0;
//}

void* my_memmove(void* dest, void* src, size_t value)
{
	assert(dest);
	assert(src);
	void* ret = dest;
	if (dest < src)
	{
		while (value--)
	    {
			*(char*)dest = *(char*)src;
			(char*)dest = (char*)dest + 1;
			(char*)src = (char*)src + 1;
	    }
	}
	else
	{
		while (value--)
		{
			*((char*)dest+value) = *((char*)src+value);
		}
	}
	return ret;
}

int main()
{
	int arr1[20] = { 1,2,3,4,5,7,8,9 };
	int arr2[5] = { 0,0,0,0,0 };
	my_memmove(arr1 + 2, arr1, 16);
	return 0;
}